package lab

// Omit 根据给定的多个下标从数组中排除元素，返回一个新的数组
func Omit[T any](array []T, indices ...int) []T {
	keys := make(map[int]bool, len(indices))
	for _, i := range indices {
		keys[i] = true
	}
	var result []T
	for i, v := range array {
		if false == keys[i] {
			result = append(result, v)
		}
	}
	return result
}
